1. Field of the Invention
The present invention relates to a technique for encoding moving images.
2. Description of the Related Art
Currently, digital devices capable of recording moving images, such as digital video cameras, and hard disk recorders, are widespread. In order to efficiently record moving images having a large amount of information in a recording medium such as a flash memory or a hard disk with limited capacity, these digital devices compress and encode moving image data.
Various methods have been proposed and become standardized as moving image compression/encoding methods. Typical moving image compression/encoding methods are the MPEG-2 encoding method and the H.264 encoding method. The MPEG-2 encoding method is an encoding method used for DVDs (Digital Versatile Discs) and the like. The H.264 encoding method is employed for AVCHD, which is a high-definition recording method for video cameras, and for 1seg broadcasting of terrestrial digital broadcasts. Both of these are widespread moving image compression/encoding methods.
YCbCr signals are used as input signals in such encoding methods. A YCbCr signal is obtained by performing color space conversion on an RGB signal to obtain a luminance signal Y and two color difference signals Cb and Cr.
Since the color difference signals Cb and Cr are lower in visibility than the luminance signal Y, even if their resolution is reduced, there is little visual influence. Therefore, it is possible to reduce the amount of information by down-sampling the color difference signals. A YCbCr 4:2:2 format reducing by one-half the number of pixels of color difference signals in the horizontal direction, and a YCbCr 4:2:0 format reducing by one-half the number of pixels both in the horizontal direction and in the vertical direction are examples of formats that reduce the amount of information.
In image encoding apparatuses, it is possible to reduce the amount of code, or reduce the various amounts of processing at the time of encoding using this YCbCr 4:2:2 format or YCbCr 4:2:0 format.
On the other hand, with an increase in resolution and an increase in gradation of displays and video cameras in recent years, encoding methods for encoding RGB signals directly, and providing encoded images with higher quality are also standardized. An RGB signal has the same number of pixels in each plane of RGB, and is also referred to as a signal of an RGB 4:4:4 format. Examples of encoding apparatuses encoding signals of the RGB 4:4:4 format include the apparatus disclosed in Japanese Patent Laid-Open No. 2008-172599 (Patent document 1), or Japanese Patent Laid-Open No. 2010-110006 (Patent document 2).
Meanwhile, in moving image recording with conventional MPEG methods, encoding is provisionally performed using images input prior to the encoding of images (hereinafter, this encoding operation is referred to as “provisional encoding”). Moreover, a technique to adequately control the amount of code of the subsequent stream to be recorded using the result of the amount of generated code and the like at the time of the provisional encoding has been proposed. An example for this is Japanese Patent Laid-Open No. 2008-124937 (Patent document 3). By the adoption of such provisional encoding, an improvement in the image quality of encoded images is achieved.
Processing on a sequence to be encoded is performed for each plane in encoding processing of encoding methods corresponding to the 4:4:4 format. Therefore, the processing amount is huge, and it is possible that frame processing is not finished during a predetermined period (for example, vertical synchronization time) relative to a moving image. Therefore, although it is important to maintain or improve image quality while reducing calculation processing, no technique to meet such a demand has been established so far.